package easypal.brilliard.world.brilliards.logic;

public class BallColor {
	public static final BallColor white =  new BallColor(4);
	public static final BallColor red = new BallColor(1);
	public static final BallColor green = new BallColor(2);
	public static final BallColor yellow = new BallColor(3);
	public static final BallColor brown = new BallColor(4);
	public static final BallColor blue = new BallColor(5);
	public static final BallColor pink = new BallColor(6);
	public static final BallColor black = new BallColor(7);
	
	public static final BallColor multicolor = new BallColor(0);
	public static final BallColor unknown = new BallColor(0);
	
	private int score;
	
	private BallColor(int score) {
		this.score = score;
	};
	
	public int getScore() {
		return score;
	}
	
	public String toString() {
		if (this == BallColor.black)
			return "Black";
		else if (this == BallColor.blue)
			return "Blue";
		else if (this == BallColor.brown)
			return "Brown";
		else if (this == BallColor.green)
			return "Green";
		else if (this == BallColor.pink)
			return "Pink";
		else if (this == BallColor.red)
			return "Red";
		else if (this == BallColor.unknown)
			return "Unknown";
		else if (this == BallColor.white)
			return "White";
		else if (this == BallColor.yellow)
			return "Yellow";
		else if (this == BallColor.multicolor)
			return "Multicolor";
		else 
			return "Error";
	}
	public static BallColor parseBallColor(String color) {
		if (color.equals(BallColor.black.toString()))
			return BallColor.black;
		else if (color.equals(BallColor.blue.toString()))
			return BallColor.blue;
		else if (color.equals(BallColor.brown.toString()))
			return BallColor.brown;
		else if (color.equals(BallColor.green.toString()))
			return BallColor.green;
		else if (color.equals(BallColor.pink.toString()))
			return BallColor.pink;
		else if (color.equals(BallColor.red.toString()))
			return BallColor.red;
		else if (color.equals(BallColor.white.toString()))
			return BallColor.white;
		else if (color.equals(BallColor.yellow.toString()))
			return BallColor.yellow;
		else if (color.equals(BallColor.multicolor.toString()))
			return BallColor.multicolor;
		else 
			return BallColor.unknown;
	}
}
